package com.example.sys.wx.handler;/*
package com.example.sys.wx.handler;

import com.example.sys.wx.po.SysWxEventMessage;
import com.example.sys.wx.service.SysWxEventMessageService;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.session.WxSessionManager;
import me.chanjar.weixin.mp.api.WxMpService;
import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Map;

@Service
public class UserEventMessageHandler extends AbstractWxMpMessageHandler {

    Logger logger = LoggerFactory.getLogger(getClass());

    @Resource
    private SysWxEventMessageService sysWxEventMessageService;

    @Override
    public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage, Map<String, Object> context, WxMpService wxMpService, WxSessionManager sessionManager) throws WxErrorException {
        SysWxEventMessage sysWxEventMessage = new SysWxEventMessage();
        sysWxEventMessage.setEventKey(wxMessage.getEventKey());
        sysWxEventMessage.setEvent(wxMessage.getEvent());
        sysWxEventMessage.setFromUser(wxMessage.getFromUser());
        sysWxEventMessage.setToUser(wxMessage.getToUser());
        sysWxEventMessage.setTicket(wxMessage.getTicket());
        this.sysWxEventMessageService.save(sysWxEventMessage);
        return WxMpXmlOutMessage.TEXT().build();
    }
}*/
